<extend name="Public/header" />
<block name="main">
    <div class="col-lg-10">
        <div class="panel panel-default">
            <div class="panel-heading">
                Basic Form Elements
            </div>
            <div class="panel-body">
                <div class="row">
                    <div class="col-lg-8">
                        <form role="form" action="{:U('edit')}" method="post" enctype="multipart/form-data">
                                  <div class="form-group">
                                 <label>商家名称</label>
                                 <br>
                                <select name="bid" class="form-control">
                                    <foreach name="list1" item="val">
                                        <option value="{$val.id}">{$val.name}</option>
                                    </foreach>
                                </select>
                            </div>
                            <div class="form-group">
                                 <label>商品名称</label>
                                 <br>
                                <select name="gid" class="form-control">
                                    
                                <foreach name="list" item="val">
                                        <option value="{$val.id}" {$info['gid']==$val.id}?'checked':''}>{$val.name}</option>
                                    </foreach>
                                </select>
                            </div>
                             <div id="div">
                                <label>原轮播图片</label>
                                <div class="form-group">
                                    <td><img width="100" src="__ROOT__{$info.img}" alt=""></td>
                                    <input type="hidden" value="{$info['id']}"  name='id'>
                                </div>
                            </div>
                            <div class="form-group">
                                <label>轮播图片</label>
                                <input type="file" name="img">
                            </div>
                            <div class="form-group">
                                    <label>开始时间：</label>
                                    <!--指定 date标记-->
                                    <div class='input-group date' id='dates'>
                                        <input type='text' class="form-control" name="start" value="{:date('Y-m-d H:i:s',$info['start'])}" />
                                        <span class="input-group-addon">
                                            <span class="glyphicon glyphicon-calendar"></span>
                                        </span>
                                    </div>
                                <script>
                                    $("#dates").datetimepicker();
                                </script>
                                <script>
                                    $("#dates").datetimepicker({
                                        format: "yyyy-mm-dd",
                                        autoclose: true,
                                        todayBtn: true,
                                        todayHighlight: true,
                                        showMeridian: true,
                                        pickerPosition: "bottom-left",
                                        language: 'zh-CN',//中文，需要引用zh-CN.js包
                                        startView: 2,//月视图
                                        minView: 2//日期时间选择器所能够提供的最精确的时间选择视图
                                    });
                                </script>
                                </div>
                              <div class="form-group">
                                    <label>结束时间：</label>
                                    <!--指定 date标记-->
                                    <div class='input-group date' id='date'>
                                        <input type='text' class="form-control" name="stop"
                                         value="{:date('Y-m-d H:i:s',$info['stop'])}" />
                                        <span class="input-group-addon">
                                            <span class="glyphicon glyphicon-calendar"></span>
                                        </span>
                                    </div>
                                </div>
                            <script>
                                $("#date").datetimepicker();
                            </script>
                            <script>
                                $("#date").datetimepicker({
                                    format: "yyyy-mm-dd",
                                    autoclose: true,
                                    todayBtn: true,
                                    todayHighlight: true,
                                    showMeridian: true,
                                    pickerPosition: "bottom-left",
                                    language: 'zh-CN',//中文，需要引用zh-CN.js包
                                    startView: 2,//月视图
                                    minView: 2//日期时间选择器所能够提供的最精确的时间选择视图
                                });
                            </script>
                            <div class="form-group">
                                <label>是否显示</label>
                                <input value = "1" type="radio" name="state" {$info['state']==1?'checked':''} >显示
                                <input value = "2" type="radio" name="state" {$info['state']==2?'checked':''} >隐藏
                            </div>
                            <button type="submit" class="btn btn-default">Submit Button</button>
                            <button type="reset" class="btn btn-default">Reset Button</button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        $(function () {  
    $('#datetimepicker1').datetimepicker({  
        format: 'YYYY-MM-DD',  
        locale: moment.locale('zh-cn')  
    });  
    $('#datetimepicker2').datetimepicker({  
        format: 'YYYY-MM-DD hh:mm',  
        locale: moment.locale('zh-cn')  
    });  
}); 
        
    </script>>
</block>